Skip to content

fix: setup tool enterprise hardening (v0.5.2)#21

Merged
kolkov merged 1 commit into
mainfrom
fix/setup-enterprise-hardening
May 27, 2026
Merged

fix: setup tool enterprise hardening (v0.5.2)#21
kolkov merged 1 commit into
mainfrom
fix/setup-enterprise-hardening

Conversation

@kolkov
Copy link
Copy Markdown
Contributor

@kolkov kolkov commented May 27, 2026

Summary

  • Security: HTTP timeout 120s, decompression bomb protection (200MB), status code validation
  • Correctness: dst.Close() error checked, macOS DYLD_LIBRARY_PATH, wgpu.Init() searches ./lib/
  • UX: download progress indicator, README instructions for WGPU_NATIVE_PATH
  • Tests: 10 new tests (Download happy/404/network, FindLibrary env/missing/lib-dir)

Test plan

  • go build ./... all platforms
  • go vet ./... clean
  • gofmt clean
  • 17/17 nativelib+setup tests pass
  • ABI tests pass (no wgpu regression)
  • Cross-compile Linux amd64, macOS arm64
  • CI: GitHub Actions

Security:
- HTTP timeout 120s (was: no timeout, hangs forever)
- dst.Close() error checked (was: unchecked, corrupted file on Windows)
- io.LimitReader 200MB decompression bomb protection (gosec G110)
- HTTP status code validation (was: no check for 404/500)

Correctness:
- macOS prints DYLD_LIBRARY_PATH (was: LD_LIBRARY_PATH)
- wgpu.Init() searches ./lib/ (auto-setup default location)
- filepath.Abs error handled with fallback

UX:
- Download progress with Content-Length (MB)
- README: WGPU_NATIVE_PATH instructions after setup

Code quality:
- Package doc comment for nativelib
- errcheck nolint directives with reasons
- SHA256 TODO for future checksum verification

Tests:
- Download() with httptest (happy path + 404 + network error)
- FindLibrary() with env var + lib/ dir search
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
wgpu/wgpu.go 0.00% 10 Missing ⚠️

📢 Thoughts on this report? Let us know!

@kolkov kolkov merged commit 483832f into main May 27, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant